Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Switch to tab implementation #3660

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

[WIP] Switch to tab implementation #3660

wants to merge 12 commits into from

Conversation

mallexxx
Copy link
Collaborator

Task/Issue URL: https://app.asana.com/0/1202406491309510/1208236460435649/f
Tech Design URL: https://app.asana.com/0/72649045549333/1208270496320813/f

Description:

  • Switch to already open tab suggestions

Steps to test this PR:

  1. Open some tabs in different windows, pin some of them, include local files (pdf-s, html-s)
  2. Open new tab/new window/new fire window, start typing something from open tabs – validate different open tabs are suggested and opened when selected; New tab page should close when selected.

Definition of Done:


Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

@mallexxx mallexxx requested a review from tomasstrba December 11, 2024 11:41
Copy link
Contributor

@tomasstrba tomasstrba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mallexxx, this is really great feature, I love it! I added couple of comments below and would like to resolve a question of suggesting tabs between regular windows and Fire Windows in Asana.

Also, suggesting a pinned tab didn't work for me. Am I missing something?

@@ -486,6 +488,21 @@ final class AddressBarTextField: NSTextField {
}
}

private func switchTo(_ tab: OpenTab) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we encapsulate this logic somewhere else? (standalone class maybe?) It is slightly confusing to have logic for switching tabs in AddressBarTextField

@@ -52,8 +56,16 @@ final class SuggestionContainer {
let urlFactory = { urlString in
return URL.makeURL(fromSuggestionPhrase: urlString)
}

self.init(suggestionLoading: SuggestionLoader(urlFactory: urlFactory),
let openTabsProvider: OpenTabsProvider = { @MainActor in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would using WindowControllersManagerProtocol make more sense here since other data are passed this way too?

@@ -787,6 +787,16 @@ extension TabCollectionViewModel {
return nil
}

func indexInAllTabs(where condition: (Tab) -> Bool) -> TabIndex? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍 Very useful

@mallexxx mallexxx changed the title Switch to tab implementation [WIP] Switch to tab implementation Dec 12, 2024
@mallexxx mallexxx marked this pull request as draft December 12, 2024 10:03
Copy link
Contributor

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.
Messages
📖

You seem to be updating localized strings. Make sure that you request translations and include translated strings before you ship your change. See Localization Guidelines for more information.

Generated by 🚫 dangerJS against 04e7a47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants